package com.cloud.drore.eboss.operation.service.impl;

import com.cloud.drore.eboos.common.base.ResultMessage;
import com.cloud.drore.eboos.common.entity.operation.PriceAndStockToOTA;
import com.cloud.drore.eboos.exception.BusinessException;
import com.cloud.drore.eboss.operation.mapper.OTAGetProductPriceAndStockMapper;
import com.cloud.drore.eboss.operation.supplierApiService.IOTAGetProductPriceAndStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 浙江卓锐科技股份有限公司 版权所有  Copyright 2018<br>
 *
 * @Description: <br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/3/6 21:13 <br>
 * @Author: <a href="1451173193@qq.com">杨亮</a>
 */
@Service
public class OTAGetProductPriceAndStockServiceImpl implements IOTAGetProductPriceAndStockService {
    @Autowired private OTAGetProductPriceAndStockMapper getProductPriceAndStockMapper;
    @Override
    public ResultMessage<PriceAndStockToOTA> getProductPriceAndStock(Long merchantId, String productNum) throws BusinessException {
        PriceAndStockToOTA p=getProductPriceAndStockMapper.getProductPriceAndStock(merchantId,productNum);
        if(p==null){
            throw new BusinessException("未知错误！");
        }
        return new ResultMessage(p);
    }
}
